# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudIdentity.V1.Model.ModifyMembershipRolesRequest do
  @moduledoc """
  The request message for MembershipsService.ModifyMembershipRoles.

  ## Attributes

  *   `addRoles` (*type:* `list(GoogleApi.CloudIdentity.V1.Model.MembershipRole.t)`, *default:* `nil`) - The `MembershipRole`s to be added. Adding or removing roles in the same request as updating roles is not supported. Must not be set if `update_roles_params` is set.
  *   `removeRoles` (*type:* `list(String.t)`, *default:* `nil`) - The `name`s of the `MembershipRole`s to be removed. Adding or removing roles in the same request as updating roles is not supported. It is not possible to remove the `MEMBER` `MembershipRole`. If you wish to delete a `Membership`, call MembershipsService.DeleteMembership instead. Must not contain `MEMBER`. Must not be set if `update_roles_params` is set.
  *   `updateRolesParams` (*type:* `list(GoogleApi.CloudIdentity.V1.Model.UpdateMembershipRolesParams.t)`, *default:* `nil`) - The `MembershipRole`s to be updated. Updating roles in the same request as adding or removing roles is not supported. Must not be set if either `add_roles` or `remove_roles` is set.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :addRoles => list(GoogleApi.CloudIdentity.V1.Model.MembershipRole.t()) | nil,
          :removeRoles => list(String.t()) | nil,
          :updateRolesParams =>
            list(GoogleApi.CloudIdentity.V1.Model.UpdateMembershipRolesParams.t()) | nil
        }

  field(:addRoles, as: GoogleApi.CloudIdentity.V1.Model.MembershipRole, type: :list)
  field(:removeRoles, type: :list)

  field(:updateRolesParams,
    as: GoogleApi.CloudIdentity.V1.Model.UpdateMembershipRolesParams,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.CloudIdentity.V1.Model.ModifyMembershipRolesRequest do
  def decode(value, options) do
    GoogleApi.CloudIdentity.V1.Model.ModifyMembershipRolesRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudIdentity.V1.Model.ModifyMembershipRolesRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
